//
//  NavRightView.m
//  ICrEAM
//
//  Created by mac on 16/11/2.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "NavRightView.h"
@interface NavRightView()
@property (weak, nonatomic) IBOutlet UIButton *firstBtn;
@property (weak, nonatomic) IBOutlet UIButton *secondBtn;
@property (weak, nonatomic) IBOutlet UIButton *thirdBtn;
@property (weak, nonatomic) IBOutlet UIButton *fourBtn;
@property (weak, nonatomic) IBOutlet UIButton *fiveBtn;
@property (weak, nonatomic) IBOutlet UIButton *sixBtn;

@property (weak, nonatomic) IBOutlet UIButton *backHomeBtn;
@end
@implementation NavRightView
-(void)awakeFromNib{
    [super awakeFromNib];
    if(![ICrEAMTool isVW]) {
        [self.firstBtn setImage:[UIImage imageNamed:@"ico2_sk"] forState:UIControlStateNormal];
        [self.secondBtn setImage:[UIImage imageNamed:@"ico3_sk"] forState:UIControlStateNormal];
        [self.thirdBtn setImage:[UIImage imageNamed:@"ico4_sk"] forState:UIControlStateNormal];
        [self.fourBtn setImage:[UIImage imageNamed:@"ico1_sk"] forState:UIControlStateNormal];
        [self.fiveBtn setImage:[UIImage imageNamed:@"ico5_sk"] forState:UIControlStateNormal];
        [self.sixBtn setImage:[UIImage imageNamed:@"ico6_sk"] forState:UIControlStateNormal];
        [self.backHomeBtn setImage:[UIImage imageNamed:@"ico7_sk"] forState:UIControlStateNormal];
  
        
    }
}
- (IBAction)backHomePage:(id)sender {
    if ([self.delegate respondsToSelector:@selector(didbackHomePage)]) {
        [self.delegate didbackHomePage];
    }
}
+(instancetype)createNavRightView{
    return [[[NSBundle mainBundle] loadNibNamed:@"NavRightView" owner:nil options:nil]lastObject];
}
//tag 100
- (IBAction)NaviBtnClick:(UIButton *)sender {
    if ([ICrEAMUser shareICrEAMUser].userType==WorkshopType) {
        return;
    }
    switch (sender.tag) {
        case 100:
            if ([self.delegate respondsToSelector:@selector(didClickUserInfo)]) {
                [self.delegate didClickUserInfo];
            }
            break;
        case 101:
            if ([self.delegate respondsToSelector:@selector(didClickRepairHistory)]) {
                [self.delegate didClickRepairHistory];
            }
            break;
        case 102:
            if ([self.delegate respondsToSelector:@selector(didClickSearchProject)]) {
                [self.delegate didClickSearchProject];
            }
            break;
        case 103:
            if ([self.delegate respondsToSelector:@selector(didClickSearchParts)]) {
                [self.delegate didClickSearchParts];
            }
            break;
        case 104:
            if ([self.delegate respondsToSelector:@selector(didClickSearchDirectory)]) {
                [self.delegate didClickSearchDirectory];
            }
            break;
        case 105:
            if ([self.delegate respondsToSelector:@selector(didClickSetup)]) {
                [self.delegate didClickSetup];
            }
            break;
      
            
        default:
            break;
    }
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
